package ch.rheintalconnection.sysventory.presentation.panels;



import ch.rheintalconnection.sysventory.businessServices.DataService;
import ch.rheintalconnection.sysventory.businessServices.ScanningService;
import ch.rheintalconnection.sysventory.domain.User;
import ch.rheintalconnection.sysventory.presentation.MainApplicationHandler;
import ch.rheintalconnection.sysventory.technicalServices.IDataReader;

import com.vaadin.ui.HorizontalLayout;

public class ApplicationPanel extends HorizontalLayout{

	private static final long serialVersionUID = 3318924182377314243L;

	private ContentPanel contentPanel;
	private MenuPanel menuPanel;
	
	public ApplicationPanel(ScanningService scanningService, DataService dataService, IDataReader dataReader, MainApplicationHandler mainApphHandler){
		
		
		contentPanel = new ContentPanel(scanningService, dataService, dataReader);
    	menuPanel = new MenuPanel(contentPanel, mainApphHandler);
    	
    	this.addComponent(menuPanel);
    	this.addComponent(contentPanel);
    	    	
    	// Grössenverhältnis definieren
    	this.setExpandRatio(contentPanel, 1);
    	this.setExpandRatio(menuPanel, 0);
	}
	
	public void setUser(User user){
		contentPanel.setUser(user);
	}
	
}



